package com.wb.controller;

import com.wb.entity.UserModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.websocket.server.PathParam;
import javax.ws.rs.QueryParam;

@RestController(value = "loginController")
public class LoginController {

    private final Logger logger = LoggerFactory.getLogger(LoginController.class);

    @RequestMapping(value = "/login",method = RequestMethod.POST)
    public String login(UserModel userModel , HttpServletRequest request){
        logger.info("userModel: {}" , userModel);
        userModel = (UserModel)request.getAttribute("userModel");
        logger.info("request userModel: {}" , userModel);
        return "{key:succes!}";
    }
}
